<?

class Tag_Button{
	public static $XSL= '';	
}

Tag_Button::$XSL = <<< EOD
<xsl:variable name="noBtn" select="'cbtn'"/>
<xsl:variable name="yesBtn" select="'cbtn1'"/>
<xsl:variable name="unableBtn" select="'cbtn1-unable'"/>

<xsl:template match="i:button">
<xsl:choose>
  <xsl:when test="@disabled='true'">
  <xsl:call-template name="button-style">
    <xsl:with-param name="className" select="\$unableBtn"/>
  </xsl:call-template>
  </xsl:when>
  <xsl:when test="@style='yes'">
  <xsl:call-template name="button-style">
    <xsl:with-param name="className" select="\$yesBtn"/>
  </xsl:call-template>
  </xsl:when>
  <xsl:when test="@style='no'">
  <xsl:call-template name="button-style">
    <xsl:with-param name="className" select="\$noBtn"/>
  </xsl:call-template>
  </xsl:when>
</xsl:choose>
</xsl:template>

<xsl:template  name="button-style">
<xsl:param name="className"/>
<xsl:choose>
<xsl:when test="@type='button'">
<button class="{\$className}" id="{@id}" type="{@btype}" onclick="{@onclick}">
	<xsl:if test="@disabled='true'">
		<xsl:attribute name="disabled"/>
	</xsl:if>
	<xsl:value-of select="@label"/>
</button>
</xsl:when>
<xsl:when test="@type='link'">
<a class="{\$className}" id="{@id}" onclick="{@onclick}" href="{@href}">
	<xsl:if test="@disabled='true'">
		<xsl:attribute name="disabled"/>
	</xsl:if>
	<xsl:value-of select="@label"/>
</a>
</xsl:when>
</xsl:choose>
</xsl:template>
EOD;
